package priv.abadstring.study.haoke.webapi.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import priv.abadstring.study.haoke.webapi.manage.ImageManage;
import priv.abadstring.study.haoke.webapi.vo.image.ImageUploadVO;

import javax.annotation.Resource;

/**
 * ImageController
 *
 * @author aBadString
 * @date 2021-06-15 17:43:18
 */
@RestController
@RequestMapping("image")
public class ImageController {
    @Resource(name = "imageManageByFileSystem")
    private ImageManage imageManage;

    @PostMapping("upload")
    public ImageUploadVO upload(@RequestParam("image") MultipartFile multipartFile) {
        return this.imageManage.upload(multipartFile);
    }
}
